home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD-ROM Today - The Disc! 5
/
CD-ROM Today - The Disc (Issue 5)(November 1994).ISO
/
mac
/
Mac shareware
/
Utilities
/
Kill Drive ƒ
/
Kill Drive.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-09-21
|
865b
|
68 lines
// UTableBase = 0x11C, /*[GLOBAL VAR] Base address of unit table unit I/O table [pointer]*/
// UnitNtryCnt = 0x1D2, /*[GLOBAL VAR] count of entries in unit table [word]*/
Ptr FindMI(void);
void main(void)
{
Handle h,u;
int x,y;
DCtlPtr d;
Ptr miptr;
miptr=FindMI();
;;
if (miptr)
{
u=(Handle)UTableBase;
for (x=1;x<UnitNtryCnt;x++)
{
if (u[x])
{
h=(Handle)(u[x]);
if (h)
{
d=(DCtlPtr)((Handle)(h[0]));
if (d->dCtlRefNum == 0xFFFB)
{
y++;
u[x]=miptr;
y++;
}
}
}
}
}
}
Ptr FindMI(void)
{
Handle h,u;
int x;
DCtlPtr d;
Ptr miptr=0;
u=(Handle)UTableBase;
for (x=1;x<UnitNtryCnt;x++)
{
if (u[x])
{
h=(Handle)(u[x]);
if (h)
{
d=(DCtlPtr)((Handle)(h[0]));
if (d->dCtlRefNum == 0xFFE0)
{
miptr=u[x];
}
}
}
}
return miptr;
}